package ontowebapp.reversestring.control.lib;

import ontocompo.control.api.ControllerItf;
import ontocompo.control.lib.Controller;

import org.objectweb.fractal.fraclet.annotations.Component;
import org.objectweb.fractal.fraclet.annotations.Interface;
import org.objectweb.fractal.fraclet.annotations.Requires;

@Component(provides = {@Interface(name = "controllerItf", signature = ontocompo.control.api.ControllerItf.class), @Interface(name = "ontocompoIntrospectionItf", signature = ontocompo.api.IntrospectionItf.class)})
public class ReverseController extends Controller implements ControllerItf {

	@Requires(name = "textToReverseInput")
	private ontocompo.ui.api.TextInputItf textToReverseInput;
	
	@Requires(name = "reversedStringResult")
	private ontocompo.ui.api.LabelItf reversedStringResult;
	
	@Requires(name = "reverseService")
	private ontowebapp.reversestring.fc.api.ReverseItf reverseService;
	
	public ReverseController() {
		this.uid = "ontowebapp.reversestring.control.lib.ReverseController";
	}
	
	
	@Override
	public void execute() {
		// TODO Auto-generated method stub
		this.reversedStringResult.setContent(this.reverseService.reverse(this.textToReverseInput.getContent()));
	}

}
